﻿<?php
 GLOBAL $CFG;
require_once('../../../config.php');

require_once($CFG->libdir . '/formslib.php');
require_once($CFG->dirroot . '/local/myplugin/lib.php');
require_once($CFG->dirroot . "/local/myplugin/forms.php");



$path = $CFG->wwwroot.'/local/myplugin/curriculum/test.php';
global $DB;


/* Ket noi den file javascript - module.js */

$mycss =  $CFG->wwwroot.'/local/myplugin/css/mycss.css';

//==================load module.js========================
$jsdir =  $CFG->wwwroot.'/local/myplugin/module.js';
echo '<script src="'.$jsdir.'"></script>';

//==================start colorbox=================
echo '<script src="../colorbox/jquery.min.js"></script>';
echo '<link rel="stylesheet" href="../css/colorbox.css" />';
echo '<script src="../colorbox/jquery.colorbox.js"></script>';



/* Chuan bi trang web can hien thi */	
$url = new moodle_url($path);
$PAGE->set_url($url);
$PAGE->set_title('test');
$PAGE->set_heading('test');
$PAGE->set_pagelayout('standard');

//Them thanh menu ngang ung voi trang trong duong link
navigation_node::override_active_url(new moodle_url($path, array('param'=>'value')));

echo $OUTPUT->header();
/* Viet doan code cua ban o day */
//add tab vào trang

$mform = new form_test();
$mform->display();
echo '<script>allow_numeric_input_only("txttest");</script>';
//echo '<script>check_numeric_value();</script>';
if ($fromform = $mform->get_data()) 
{
	$value = $fromform->txttest;
	echo '<h1>'.$value.'</h1>';
	
}
echo $OUTPUT->footer();

